Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: global layer exclusivity #1249

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

spectrachrome
Copy link
Member

@spectrachrome spectrachrome commented Sep 11, 2024

Theoretically, this change should be rather straightforward, as it is mostly about the behaviour exhibited by the checkbox, which is easy to untoggle in the layer click handler inside input-click.js. However, only part of the functionality can be implemented there, as there are inconsistencies in the radio buttons when they first load, causing multiple of them to be selected simultaneously:

Screenshot 2024-12-10 at 13 25 00

In order to mitigate this, I had planned to modify the initialization procedure of the Layer Control so that it manually selects one of the radio buttons, deselecting all others. And while this works in theory, the first-update.js handler seems to run just a smidge too early for the layer list to be available. A second or two later, or even just 200ms always work.

This can be hackily implemented using a setTimeout call, but it seems to me what I am actually looking for is some kind of nextTick function that is commonly used in Vue to solve this problem.

Implemented changes

Screenshots/Videos

Checklist before requesting a review

Copy link

netlify bot commented Sep 11, 2024

Deploy Preview for eoxelements ready!

Name Link
🔨 Latest commit 7a05efd
🔍 Latest deploy log https://app.netlify.com/sites/eoxelements/deploys/675839dab651050008a221ca
😎 Deploy Preview https://deploy-preview-1249--eoxelements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@silvester-pari silvester-pari linked an issue Sep 25, 2024 that may be closed by this pull request
@spectrachrome spectrachrome self-assigned this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Globally exclusive layers
1 participant